#ifndef ALIEN_ATTACK_BULLET_H
#define ALIEN_ATTACK_BULLET_H
#include "ShooterObject.h"
#include "TextureManager.h"
#include "Game.h"
#include <iostream>

struct PlayerBullet : public ShooterObject
{
    PlayerBullet() : ShooterObject()
    {
        m_dyingTime = 5;
    }

    virtual ~PlayerBullet() {}

    virtual std::string type()
    {
        return "PlayerBullet";
    }

    virtual void load(std::unique_ptr<LoadedParams> pParams,
                      Vector2D heading)
    {
        ShooterObject::load(std::move(pParams));
        m_heading = heading;
    }
    virtual void draw()
    {
        ShooterObject::draw();
    }

    virtual void collision()
    {
        m_textureID = "smallexplosion";
        m_currentFrame = 0;
        m_numFrames = 2;
        m_width = 20;
        m_height = 20;
        m_bDying = true;
    }

    virtual void update()
    {
        if (!m_bDying)
        {
            m_velocity.setX(m_heading.getX());
            m_velocity.setY(m_heading.getY());

            ShooterObject::update();
        }
        else
        {
            m_velocity.setX(0);
            m_velocity.setY(0);
            doDyingAnimation();
        }
    }

    virtual void clean()
    {
        ShooterObject::clean();
    }

private:
    Vector2D m_heading;
};

struct EnemyBullet : public PlayerBullet
{
    EnemyBullet() : PlayerBullet()
    {
    }

    virtual ~EnemyBullet() {}

    virtual std::string type()
    {
        return "EnemyBullet";
    }
};

#endif // header file protect